package com.ztorn.controller;

import com.ztorn.dtos.ApiResult;
import com.ztorn.dtos.InvReqDTO;
import com.ztorn.services.InvService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
@Slf4j
public class InvController {

    @Autowired
    private InvService invService;

    @RequestMapping("/invSearch")
    public ApiResult invSearch(@RequestBody InvReqDTO invReqDTO) {
        return ApiResult.ok(invService.getInvDetail(invReqDTO.getWhse(),invReqDTO.getSku()));
    }
}
